﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using JBeamLibrary.VehicleParts.Collections;
using JBeamLibrary.VehicleParts.Elements;

namespace JBeamLibrary.VehicleParts.Groups
{
    public class PropSection : VehicleSection<Prop>
    {
        #region Fields

        private readonly PropCollection _collection = new PropCollection();

        #endregion

        #region Indexers

        public Prop this[string nodeIdRef, string nodeIdX, string nodeIdY]
        {
            get
            {
                return _collection.FirstOrDefault(beam => beam.NodeIdRef.Equals(nodeIdRef) && beam.NodeIdX.Equals(nodeIdY));
            }
        }

        #endregion

        #region CTORs

        public PropSection(VehiclePart part)
            : base(part)
        {

        }

        #endregion

        #region VehicleSection

        public override string Name
        {
            get { return "props"; }
        }

        public override Interfaces.IVehicleGroupCollection<Prop> ElementCollection
        {
            get { return _collection; }
        }

        #endregion
    }
}
